package mvn21.model;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;


//切面类-----实现环绕通知类型
public class MyAspect implements MethodInterceptor {
	
    public void checkPermission() {
    	System.out.println("模拟权限验证....");
    	
    }
    
    public void log() {
    	System.out.println("模拟写入日志...");
    }

	@Override
	public Object invoke(MethodInvocation invocation) 
			throws Throwable {
		//checkPermission();
		//调用目标方法
		Object obj = invocation.proceed();
		log();
		return obj;
	}

}
